<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-12-12 15:02
 *
 * Version: 2.0
 */

namespace App\Modules\DataCenter\Controllers;


use App\Modules\DataCenter\Services\StatisticsService;
use Flower\Core\Http\BaseController;
use Illuminate\Http\Request;

class CashierStatisticsController extends BaseController
{

	private  $statisticsService;

	public function __construct(StatisticsService $statisticsService)
	{
		$this->statisticsService = $statisticsService;
	}

	/**
	 * 店铺数据概览
	 * @param Request $request
	 * @return mixed
	 */
	public function getDataStoreDashboardData(Request $request){
		$info = $this->statisticsService->getStoreDashboard($request->store_id,$request->date_type);

		return $this->display($info);
	}


	/**
	 * 客情
	 * @param Request $request
	 * @param @type  0可单 1 业绩
	 * @return mixed
	 */
	public function getMemberSourceData(Request $request){
		$info = $this->statisticsService->getMemberSourceData($request->store_id,$request->type);
		return $this->display($info);
	}
}